
*Replication code for:
*War and pandemic do not jeopardize Germans’ willingness to support climate measures

*by:
*Adrian Rinscheid & Sebastian Koos
*adrian.rinscheid@ru.nl

*February 24, 2023.

use "/Users/adrianrinscheid/Downloads/data_war_pandemic_climate_final.dta"


******* ******* ******* *******
*PREPARATIONS
******* ******* ******* *******

*** //// 
*rename (and partly recode) variables and inspect frequencies
rename stat2_gr5 age 
fre age
rename stat3_gr3 edu 
fre edu 
rename inc_categories income
fre income
rename stat14 kids
fre kids
rename stat1 sex
recode sex 2=. 
fre sex
rename inst3 leftright 
recode leftright 11=.d 
recode leftright 12=.r
fre leftright
gen polview = leftright
replace polview = 1 if leftright <5
replace polview = 2 if leftright ==5
replace polview = 3 if leftright >5 & leftright <11
fre polview
rename inst1a govtrust
fre govtrust
rename inst1b scitrust
fre scitrust
rename Cli3 concern
recode concern 88=.d
fre concern
rename Cli1 certain
recode certain 88=.d
fre certain
gen consensus =.
replace consensus = 1 if Cli4<=40
replace consensus = 2 if Cli4>40 & Cli4<=60
replace consensus = 3 if Cli4>60 & Cli4<=80
replace consensus = 4 if Cli4>80 
tab consensus
rename verhauto Car1 
gen car = Car1
recode car 2=1 
recode car 3=1 
recode car 4=1 
recode car 5=1 
recode car 6=2 
recode car 7=2 
fre car


******* ******* ******* *******
*DEPENDENT VARIABLES: DISTRIBUTION
******* ******* ******* *******

*** //// 
*FIGURE A (SUPPLEMENTARY INFORMATION)
*cost outcome (willingness to bear higher costs) 
label var cost "cost"
label define cost_label 1 "Very low" 2 " " 3 " " 4 " " 5 " " 6 " " 7 "Very high", replace
label value cost cost_label
graph bar, over(cost, label(angle(0))) title("Willingness to bear higher financial costs", color(black) size(medsmall)) graphregion(color(white)) bgcolor(white) 
tabstat cost, stats(n mean SD median min max)
fre cost


*** //// 
*FIGURE B (SUPPLEMENTARY INFORMATION)
*freedom outcome (willingness to give up personal freedom) 
label var free "free"
label define free_label 1 "Very low" 2 " " 3 " " 4 " " 5 " " 6 " " 7 "Very high", replace
label value free free_label
graph bar, over(free, label(angle(0))) bar(1, fcolor(red)) title("Willingness to give up personal freedoms", color(black) size(medsmall)) graphregion(color(white)) bgcolor(white) 
tabstat free, stats(n mean SD median min max)
fre free


******* ******* ******* *******
*TREATMENTS
******* ******* ******* *******

*** //// 
*treatments
*we had 4 conditions, but each was administered in 2 different variants
//with information about COVID-19 and the war being presented in random order.
*here we aggregate the 4*2 conditions to 4.
destring Vig1Crisisrand, replace
gen vigall = .
replace vigall = 1 if Vig1Crisisrand <3
replace vigall = 2 if Vig1Crisisrand ==3 | Vig1Crisisrand ==4
replace vigall = 3 if Vig1Crisisrand ==5 | Vig1Crisisrand ==6
replace vigall = 4 if Vig1Crisisrand >6 
tab vigall
label var vigall "vignettes"
label define newvar_label 1 "No crisis" 2 "War" 3 "COVID-19" 4 "Two crises", replace
label value vigall newvar_label
graph bar, over(vigall, label(angle(45))) title("Vignettes 1-4", size(medsmall)) 

*we pool them further for later analyses of heterogenous treatment effects.

*the following new var pools conditions in which the war has ended ("No war") 
//and conditions in which it has a serious impact ("War")
gen war = .
replace war = 1 if vigall ==1 | vigall ==3
replace war = 2 if vigall ==2 | vigall ==4

*the following new var pools conditions in which COVID has ended ("No COVID-19") 
//and conditions in which it has worsened again ("COVID-19")
gen covid = .
replace covid = 1 if vigall ==1 | vigall ==2
replace covid = 2 if vigall ==3 | vigall ==4

*** //// 
*Check: Are the 4 conditions balanced wrt demographics + political orientation?
mlogit vigall age edu kids sex leftright, b(1)
mlogit vigall age edu kids sex leftright, b(2)
mlogit vigall age edu kids sex leftright, b(3)
*No significant differences.


******* ******* ******* *******
*ANALYSIS
******* ******* ******* *******

*** //// 
*FIGURE 1A
*linear regression, cost outcome
reg cost i.vigall age edu sex polview concern consensus certain govtrust scitrust car
coefplot, msize(large) drop(_cons age edu sex polview concern consensus certain govtrust scitrust car) xline(0, lcolor(black) lpattern(dash)) omitted base pstyle(p16) ciopts(recast(rcap) lwidth(*2)) title((a) Effects on willingness to bear higher financial costs, pos(11) color(black)) graphregion(color(white)) bgcolor(white) ysize(5) xsize(7.5) ylabel(, labsize(large)) xlabel(, labsize(large))
estimates store cost
esttab cost, se one
esttab cost using "C:\cost.rtf", se one r2 mtitles(Support for type 1 measures) nonum repl

******* ******* ******* *******
*additional analyses
******* ******* ******* *******

*excluding political view increases the n strongly (up to 5,079)
reg cost i.vigall age edu sex concern consensus certain govtrust scitrust car
*the results are similar, but some effects appear more pronounced in this specification.
*we report the more conservative estimates in the paper and leave out this specification, though.

*using weights to correct for oversampling of respondents from Eastern Germany.
*this leads to substantively similar results, but stronger effects. 
reg cost i.vigall age edu sex polview concern consensus certain govtrust scitrust car [pweight=weights]

*regression without covariates
reg cost i.vigall 
estimates store costlean
esttab costlean, se one
esttab costlean using "C:\costlean.rtf", se one r2 mtitles(Support for type 1 measures) nonum repl
*the effects appear more pronounced.


*** //// 
*FIGURE 1B
*linear regression, freedom outcome
reg free i.vigall age edu sex polview concern consensus certain govtrust scitrust car
coefplot, msize(large) drop(_cons age edu sex polview concern consensus certain govtrust scitrust car) xline(0, lcolor(black) lpattern(dash)) omitted base pstyle(p6) ciopts(recast(rcap) lwidth(*2)) title((b) Effects on willingness to give up personal freedoms, pos(11) color(black)) graphregion(color(white)) bgcolor(white) ysize(5) xsize(7.5) ylabel(, labsize(large)) xlabel(, labsize(large))
estimates store free
esttab free, se one
esttab free using "C:\free.rtf", se one r2 mtitles(Support for type 2 measures) nonum repl

******* ******* ******* *******
*additional analyses
******* ******* ******* *******

*using weights to correct for oversampling of respondents from Eastern Germany.
*this leads to substantively similar results, and minimally weaker effects. 
reg free i.vigall age edu sex polview concern consensus certain govtrust scitrust car [pweight=weights]

*excluding political view increases the n strongly (up to 5,074)
reg free i.vigall age edu sex concern consensus certain govtrust scitrust car
*the results are similar, but some effects appear more pronounced in this specification.
*we report the more conservative estimates in the paper and leave out this specification, though.

*regression without covariates
reg free i.vigall 
estimates store freelean
esttab freelean, se one
esttab freelean using "C:\freelean.rtf", se one r2 mtitles(Support for type 1 measures) nonum repl
*the effects are substantively similar.

******* ******* ******* *******

*** //// 
*heterogeneous treatment effects reported in the paper

******* ******* ******* *******
*preparation
*trust binary
gen trustbin =.
replace trustbin = 0 if govtrust <5
replace trustbin = 1 if govtrust >4
tab trustbin govtrust

*concerned: 1=not or very little, 2=a bit, 3=strongly or extremely
gen concerned = .
replace concerned = 1 if concern <3
replace concerned = 2 if concern ==3
replace concerned = 3 if concern ==4 | concern ==5 
replace concerned = 88 if concern ==88
label var concerned "concerned"
label define concerned_label 1 "Not concerned" 2 "A bit concerned" 3 "Strongly concerned" 88 "Dont know", replace
label value concerned concerned_label
******* ******* ******* *******

******* ******* ******* *******
*cost outcome
*based on pooled conditions No War / War

*** //// 
*FIGURE 2A
*trust in government
*** *** ***
reg cost i.war#i.trustbin age edu sex polview concerned consensus certain car scitrust 
margins, at(war=1 trustbin=0 trustbin=1) atmeans post
estimates store war1
qui reg cost i.war#i.trustbin age edu sex polview concerned consensus certain car scitrust 
margins, at(war=2 trustbin=0 trustbin=1) atmeans post
estimates store war2
coefplot (war1, pstyle(p5)) (war2, pstyle(p2)), msize(large) ciopts(recast(rcap) lwidth(*2)) yscale(reverse) recast(scatter) drop(_cons) title((a) Effects on willingness to bear higher financial costs, pos(11) color(black)) plotlabels("No war" "War") coeflabels(1._at="Low trust" 2._at="High trust") graphregion(color(white)) bgcolor(white) ysize(4.5) xsize(9)

*FIGURE 2C
*climate concern
*** *** ***
reg cost i.war#i.concerned age edu sex polview consensus certain car govtrust scitrust 
margins, at(war=1 concerned=1 concerned=2 concerned=3) atmeans post
estimates store war1
qui reg cost i.war#i.concerned age edu sex polview consensus certain car govtrust scitrust 
margins, at(war=2 concerned=1 concerned=2 concerned=3) atmeans post
estimates store war2
coefplot (war1, pstyle(p5)) (war2, pstyle(p2)), msize(large) ciopts(recast(rcap) lwidth(*2)) yscale(reverse) recast(scatter) drop(_cons) title((c), pos(11) color(black)) plotlabels("No war" "War") coeflabels(1._at="Not concerned" 2._at="A bit concerned" 3._at="Strongly concerned") graphregion(color(white)) bgcolor(white) ysize(4.5) xsize(9)


******* ******* ******* *******
*freedom outcome
*based on pooled conditions No COVID-19/COVID-19

*FIGURE 2B
*trust in government
*** *** ***
reg free i.covid#i.trustbin age edu sex polview concerned consensus certain car scitrust 
margins, at(covid=1 trustbin=0 trustbin=1) atmeans post
estimates store covid1
qui reg free i.covid#i.trustbin age edu sex polview concerned consensus certain car scitrust 
margins, at(covid=2 trustbin=0 trustbin=1) atmeans post
estimates store covid2
coefplot (covid1, pstyle(p11)) (covid2, pstyle(p14)), msize(large) ciopts(recast(rcap) lwidth(*2)) yscale(reverse) recast(scatter) drop(_cons) title("(b) Effects on willingness to give up personal freedoms", pos(11) color(black)) plotlabels("No COVID-19" "COVID-19") coeflabels(1._at=" " 2._at=" ") graphregion(color(white)) bgcolor(white) ysize(4.5) xsize(9)

*FIGURE 2D
*climate concern
*** *** ***
reg free i.covid#i.concerned age edu sex polview consensus certain car govtrust scitrust
margins, at(covid=1 concerned=1 concerned=2 concerned=3) atmeans post
estimates store covid1
qui reg free i.covid#i.concerned age edu sex polview consensus certain car govtrust scitrust
margins, at(covid=2 concerned=1 concerned=2 concerned=3) atmeans post
estimates store covid2
coefplot (covid1, pstyle(p11)) (covid2, pstyle(p14)), msize(large) ciopts(recast(rcap) lwidth(*2)) yscale(reverse) recast(scatter) drop(_cons) title((d), pos(11) color(black)) plotlabels("No COVID-19" "COVID-19") coeflabels(1._at=" " 2._at=" " 3._at=" ") graphregion(color(white)) bgcolor(white)  ysize(4.5) xsize(9)


******* ******* ******* *******
*** //// 
*heterogeneous treatment effects NOT reported in the paper, using 4 treatments (without pooling)

*cost outcome
*trust in government
*** *** ***
reg cost i.vigall#i.trustbin age edu sex polview concerned consensus certain car scitrust 
margins, at(vigall=1 trustbin=0 trustbin=1) atmeans post
estimates store vigall1
qui reg cost i.vigall#i.trustbin age edu sex polview concerned consensus certain car scitrust 
margins, at(vigall=2 trustbin=0 trustbin=1) atmeans post
estimates store vigall2
qui reg cost i.vigall#i.trustbin age edu sex polview concerned consensus certain car scitrust 
margins, at(vigall=3 trustbin=0 trustbin=1) atmeans post
estimates store vigall3
qui reg cost i.vigall#i.trustbin age edu sex polview concerned consensus certain car scitrust 
margins, at(vigall=4 trustbin=0 trustbin=1) atmeans post
estimates store vigall4
coefplot (vigall1, pstyle(p1)) (vigall2, pstyle(p4)) (vigall3, pstyle(p11)) (vigall4, pstyle(p12)), msize(large) ciopts(recast(rcap) lwidth(*2)) yscale(reverse) recast(scatter) drop(_cons) title(Effects on willingness to bear higher financial costs, pos(11) color(black)) plotlabels("No crisis" "War" "COVID-19" "Two crises") coeflabels(1._at="Low trust" 2._at="High trust") graphregion(color(white)) bgcolor(white) ysize(4.5) xsize(9)

*cost outcome
*climate concern
*** *** ***
reg cost i.vigall#i.concerned age edu sex polview consensus certain car govtrust scitrust 
margins, at(vigall=1 concerned=1 concerned=2 concerned=3) atmeans post
estimates store vigall1c
qui reg cost i.vigall#i.concerned age edu sex polview consensus certain car govtrust scitrust 
margins, at(vigall=2 concerned=1 concerned=2 concerned=3) atmeans post
estimates store vigall2c
qui reg cost i.vigall#i.concerned age edu sex polview consensus certain car govtrust scitrust 
margins, at(vigall=3 concerned=1 concerned=2 concerned=3) atmeans post
estimates store vigall3c
qui reg cost i.vigall#i.concerned age edu sex polview consensus certain car govtrust scitrust 
margins, at(vigall=4 concerned=1 concerned=2 concerned=3) atmeans post
estimates store vigall4c
coefplot (vigall1c, pstyle(p1)) (vigall2c, pstyle(p4)) (vigall3c, pstyle(p11)) (vigall4c, pstyle(p12)), msize(large) ciopts(recast(rcap) lwidth(*2)) yscale(reverse) recast(scatter) drop(_cons) title(Effects on willingness to bear higher financial costs, pos(11) color(black)) plotlabels("No crisis" "War" "COVID-19" "Two crises") coeflabels(1._at="Not concerned" 2._at="A bit concerned" 3._at="Strongly concerned") graphregion(color(white)) bgcolor(white) ysize(4.5) xsize(9)

*freedom outcome
*trust in government
*** *** ***
reg free i.vigall#i.trustbin age edu sex polview concerned consensus certain car scitrust 
margins, at(vigall=1 trustbin=0 trustbin=1) atmeans post
estimates store vigall1ft
qui reg free i.vigall#i.trustbin age edu sex polview concerned consensus certain car scitrust 
margins, at(vigall=2 trustbin=0 trustbin=1) atmeans post
estimates store vigall2ft
qui reg free i.vigall#i.trustbin age edu sex polview concerned consensus certain car scitrust 
margins, at(vigall=3 trustbin=0 trustbin=1) atmeans post
estimates store vigall3ft
qui reg free i.vigall#i.trustbin age edu sex polview concerned consensus certain car scitrust 
margins, at(vigall=4 trustbin=0 trustbin=1) atmeans post
estimates store vigall4ft
coefplot (vigall1ft, pstyle(p1)) (vigall2ft, pstyle(p4)) (vigall3ft, pstyle(p11)) (vigall4ft, pstyle(p12)), msize(large) ciopts(recast(rcap) lwidth(*2)) yscale(reverse) recast(scatter) drop(_cons) title(Effects on willingness to give up personal freedoms, pos(11) color(black)) plotlabels("No crisis" "War" "COVID-19" "Two crises") coeflabels(1._at="Low trust" 2._at="High trust") graphregion(color(white)) bgcolor(white) ysize(4.5) xsize(9)

*freedom outcome
*climate concern
*** *** ***
reg free i.vigall#i.concerned age edu sex polview consensus certain car govtrust scitrust 
margins, at(vigall=1 concerned=1 concerned=2 concerned=3) atmeans post
estimates store vigall1fc
qui reg free i.vigall#i.concerned age edu sex polview consensus certain car govtrust scitrust 
margins, at(vigall=2 concerned=1 concerned=2 concerned=3) atmeans post
estimates store vigall2fc
qui reg free i.vigall#i.concerned age edu sex polview consensus certain car govtrust scitrust 
margins, at(vigall=3 concerned=1 concerned=2 concerned=3) atmeans post
estimates store vigall3fc
qui reg free i.vigall#i.concerned age edu sex polview consensus certain car govtrust scitrust 
margins, at(vigall=4 concerned=1 concerned=2 concerned=3) atmeans post
estimates store vigall4fc
coefplot (vigall1fc, pstyle(p1)) (vigall2fc, pstyle(p4)) (vigall3fc, pstyle(p11)) (vigall4fc, pstyle(p12)), msize(large) ciopts(recast(rcap) lwidth(*2)) yscale(reverse) recast(scatter) drop(_cons) title(Effects on willingness to give up personal freedoms, pos(11) color(black)) plotlabels("No crisis" "War" "COVID-19" "Two crises") coeflabels(1._at="Not concerned" 2._at="A bit concerned" 3._at="Strongly concerned") graphregion(color(white)) bgcolor(white) ysize(4.5) xsize(9)



** ** ** ** ** ** ** ** ** ** ** **
